package com.game.utils;

import android.graphics.Color;
import android.graphics.Paint;


public class Tools {
	
	
	/**
	 * 创建新的画笔
	 * @return
	 */
	public static Paint createNewPaint(){
		Paint paint = null;
		paint=new Paint();
		paint.setColor(Color.WHITE);
//		paint.setAntiAlias(true);//设置画笔无锯齿
//		paint.setFilterBitmap(true);
		return paint ;
	}
	
	
	/**
	 * 判断touch是否在区域内
	 * @param touchX
	 * @param touchY
	 * @param startX
	 * @param startY
	 * @param endX
	 * @param endY
	 * */
	public static boolean isTouchInRegion(int touchX,int touchY,int startX,int startY,int endX, int endY){
		if( touchX > startX && touchX < endX ){
			if( touchY > startY && touchY < endY ){
				return true;
			}
		}
		return false;
	}
	
	/**
	 * 延迟线程方法*/
	public static void DelayTime( long time ){
		try{
			Thread.sleep( time );
		}catch( Exception ex ){
			ex.printStackTrace();
		}
	}
	
}